#define  _CRT_SECURE_NO_WARNINGS 1

#include <stdio.h>

 int findnum(int (*pa)[3], int x, int y, int num)
{
	 int i = 0, j = 0;

	 while (i < x && j < y)
	 {
		 if (pa[i][j] == num)
		 {
			 return 1;
		 }
		 else if (pa[i][j] < num)
		 {
			 i++;
		 }
		 else if (pa[i][j] > num)
		 {
			 j++;
		 }
	 }

	 return 0;
}

int main()
{
	int a[3][3] = { {1, 3, 5},
			        {3, 5, 7},
			        {5, 7, 9} };

	if (findnum(a, 3, 3, 0))
	{
		printf("Got it!\n");
	}
	else
	{
		printf("Don't be find!\n");
	}

	return 0;
}